6b7dd3ba5544703ca5a2df3a0add8840c62798a8,spring-social-google-quickstart/spring-social-quickstart/src/main/java/org/springframework/social/quickstart/HomeController.java,HomeController,contacts,#String#,84
Before Change
List<ContactGroup> groups = google.contactOperations().getContactGroupList();
List<Contact> contacts;
if(groupId == null) {
contacts = google.contactOperations().getContactList();
} else {
contacts = google.contactOperations().getGroupContacts(groupId);
}
return new ModelAndView("contacts")
.addObject("groups", groups)
.addObject("contacts", contacts);
}
@RequestMapping(value="/group", method=GET)
After Change
List<ContactGroup> groups = google.contactOperations().getContactGroupList();
Page<Contact> contacts = google.contactOperations().contactQuery()
.searchFor(command.getText())
.startingFromIndex(command.getStartIndex())
.maxResultsNumber(command.getMaxResults())
.updatedFrom(command.getUpdatedMin())
.updatedUntil(command.getUpdatedMax())
.onGroup(isNotBlank(command.getGroupId()) ?new ContactGroup(command.getGroupId(), null, null, null) : null)
.getPage();
return new ModelAndView("contacts")
.addObject("groups", groups)
.addObject("contacts", contacts)
.addObject("command", command);
}
@RequestMapping(value="/groups", method=GET)